import React, { Component } from 'react'
import {ListBox} from '../../../components'

// 登录日志查询
export default class LoginLogPage extends Component {
    constructor(props) {
        super(props);

        //行操作列表
        this.rowOperation = [
           
        ];
        //header 操作列表
        this.headerOperation = [
           
        ];
    }
    rowHandles = (strHandles, rowObj) => {
      
    }

    render() {
        //当左侧隐藏时，列表宽度加上左侧的宽度，
        //1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
        //2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
        let isHideLeft = this.props.isHideLeft;
        let searchComponentData = [
            {
                name:'gmtCreate',
                type: 'date',
                maxName:'gmtCreateMax', 
                minName:'gmtCreateMin' 
            },{
                name : 'clientType',
                type : 'select',
                optionList:[
                    {
                        optionKey:'',
                        optionShow:''
                    },{
                        optionKey:'0',
                        optionShow:'PC'
                    },{
                        optionKey:'1',
                        optionShow:'手持'
                    }
                ]
            },{
                name : 'logType',
                type : 'select',
                optionList:[
                    {
                        optionKey:'',
                        optionShow:''
                    },{
                        optionKey:'0',
                        optionShow:'登入'
                    },{
                        optionKey:'1',
                        optionShow:'登出'
                    }
                ]
            }
        ];
        //showName、columnName 必有属性， columnWidth 可选，默认100
        let tableColumn = {
            storageKey: 'ListUserColumnConfig',
            data: [
                {
                    showName: '操作人',
                    columnName: 'createBy',
                    columnWidth: 130
                },{
                    showName: '操作时间',
                    columnName: 'gmtCreate'
                },{
                    showName: '工厂编码',
                    columnName: 'factoryCode'
                },{
                    showName: '客户端类型',
                    columnName: 'clientType',
                    showOption:[
                        {
                            optionKey:'',
                            optionShow:''
                        },{
                            optionKey:'0',
                            optionShow:'PC'
                        },{
                            optionKey:'1',
                            optionShow:'手持'
                        }
                    ]
                },{
                    showName: '类型',
                    columnName: 'logType',
                    showOption:[
                        {
                            optionKey:'',
                            optionShow:''
                        },{
                            optionKey:'0',
                            optionShow:'登入'
                        },{
                            optionKey:'1',
                            optionShow:'登出'
                        }
                    ]
                }
            ]
        };
        return(
            <ListBox
                ref = 'listLoginLog'
                title="登录日志"
                isHideLeft={isHideLeft}
                tableColumnData = {tableColumn}
                searchComponentData={searchComponentData}
                url = '/base/auth/log/login/list'
                rowHandles = {this.rowHandles}
                rowOperation = {this.rowOperation}
                headerOperation = {this.headerOperation}
                isRowSingle = "true"
            />
        )
    }
}
